package com.cjlgb.design.upms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cjlgb.design.upms.api.entity.SysMenu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author WFT
 * @date 2019/7/31
 * description: 系统菜单-DAO接口
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    /**
     * 查询某菜单下子节点列表中,最大的排序值
     * @param pid 父级Id
     * @return Integer
     */
    @Select(value = "SELECT MAX(sort) FROM sys_menu WHERE pid = #{pid}")
    Integer selectMaxSortByPid(@Param(value = "pid") Long pid);

}
